import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const FloorNavigationMeta: IPublicTypeComponentMetadata = {
  componentName: 'FloorNavigation',
  title: '楼层导航',
  category: '导航',
  group: '首页',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'FloorNavigation',
    main: 'src/index.tsx',
    destructuring: true,
    subName: ''
  },
  props: [
    {
      name: 'ref',
      propType: 'object',
    },
    {
      name: 'key',
      propType: 'string',
    },
    {
      name: 'style',
      propType: 'object',
    },
    {
      name: 'className',
      propType: 'string',
    },
    {
      name: 'width',
      propType: 'number',
      description: '组件宽度'
    },
    {
      name: 'height',
      propType: 'number',
      description: '组件高度'
    },
    {
      name: 'backgroundImage',
      propType: 'string',
      description: '背景图片'
    },
    {
      name: 'backgroundColor',
      propType: 'string',
      description: '背景颜色'
    },
    {
      name: 'iconPath',
      propType: 'string',
      description: '图标路径'
    },
    {
      name: 'iconText',
      propType: 'string',
      description: '图标文字'
    },
    {
      name: 'items',
      propType: 'array',
      description: '导航项目'
    },
    {
      name: 'textColor',
      propType: 'string',
      description: '文字颜色'
    },
    {
      name: 'showIcon',
      propType: 'bool',
      description: '显示图标'
    },
    {
      name: 'theme',
      propType: 'string',
      description: '主题'
    },
    {
      name: 'onItemClick',
      propType: 'func',
      description: '项目点击事件'
    }
  ],
  configure: {
    props: [
      {
        name: 'iconText',
        title: '图标文字',
        setter: 'StringSetter',
        defaultValue: '总览'
      },
      {
        name: 'backgroundColor',
        title: '背景颜色',
        setter: 'ColorSetter',
        defaultValue: 'rgba(0, 0, 0, 0.5)'
      },
      {
        name: 'textColor',
        title: '文字颜色',
        setter: 'ColorSetter',
        defaultValue: 'rgba(255, 255, 255, 0.8)'
      },
      {
        name: 'showIcon',
        title: '显示图标',
        setter: 'BoolSetter',
        defaultValue: true
      },
      {
        name: 'backgroundImage',
        title: '背景图片',
        setter: 'StringSetter',
        defaultValue: 'http://localhost:8085/static/images/shouye/jxbf21.png'
      }
    ],
    supports: {
      style: true
    }
  }
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '楼层导航',
    screenshot: '',
    schema: {
      componentName: 'FloorNavigation',
      props: {
        width: 725,
        height: 64,
        backgroundImage: 'http://localhost:8085/static/images/shouye/jxbf21.png',
        backgroundColor: 'rgba(0, 0, 0, 0.5)',
        iconPath: 'http://localhost:8085/static/images/shouye/jxbf21.png',
        iconText: '总览',
        items: [
          { id: '2f-mezzanine', text: '2F夹层', isActive: false },
          { id: '2f', text: '2F', isActive: false },
          { id: '1f', text: '1F', isActive: false }
        ],
        textColor: 'rgba(255, 255, 255, 0.8)',
        fontSize: 20,
        fontFamily: 'SourceHanSansSC',
        fontWeight: 500,
        letterSpacing: '1.43px',
        lineHeight: '29px',
        itemSpacing: 56,
        showIcon: true,
        theme: 'dark'
      }
    }
  }
];

export default {
  ...FloorNavigationMeta,
  snippets
}; 